# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.BackupDR.V1.Model.CustomerEncryptionKey do
  @moduledoc """
  A customer-supplied encryption key.

  ## Attributes

  *   `kmsKeyName` (*type:* `String.t`, *default:* `nil`) - Optional. The name of the encryption key that is stored in Google Cloud KMS.
  *   `kmsKeyServiceAccount` (*type:* `String.t`, *default:* `nil`) - Optional. The service account being used for the encryption request for the given KMS key. If absent, the Compute Engine default service account is used.
  *   `rawKey` (*type:* `String.t`, *default:* `nil`) - Optional. Specifies a 256-bit customer-supplied encryption key.
  *   `rsaEncryptedKey` (*type:* `String.t`, *default:* `nil`) - Optional. RSA-wrapped 2048-bit customer-supplied encryption key to either encrypt or decrypt this resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :kmsKeyName => String.t() | nil,
          :kmsKeyServiceAccount => String.t() | nil,
          :rawKey => String.t() | nil,
          :rsaEncryptedKey => String.t() | nil
        }

  field(:kmsKeyName)
  field(:kmsKeyServiceAccount)
  field(:rawKey)
  field(:rsaEncryptedKey)
end

defimpl Poison.Decoder, for: GoogleApi.BackupDR.V1.Model.CustomerEncryptionKey do
  def decode(value, options) do
    GoogleApi.BackupDR.V1.Model.CustomerEncryptionKey.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.BackupDR.V1.Model.CustomerEncryptionKey do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
